// pages/common/getauth/getauth.js
const app = getApp()
Component({
    /**
     * 组件的属性列表
     */
    properties: {

    },

    /**
     * 组件的初始数据
     */
    data: {
        showAuth: false,
        canIUseGetUserInfo: wx.canIUse('button.open-type.getUserInfo'),
    },

    /**
     * 组件的方法列表
     */
    methods: {
        showAuth() {
            this.setData({
                showAuth: true
            })
        },
        //获取授权
        bindGetUserInfo(e) {
            if (e.detail.encryptedData) {
                app.globalData.encryptedData = e.detail.encryptedData
                app.globalData.iv = e.detail.iv
                this.setData({
                    showAuth: false
                })
            }
        }
    }
})